﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script  type="text/javascript">


        window.onload = function () {
            document.oncontextmenu = function (event) {
                var menu = document.getElementById("myUl");
                menu.style.visibility = "visible";
                menu.style.left = event.clientX + "px";
                menu.style.top = event.clientY + "px";
                event.preventDefault();
            }

            document.onclick = function () {
                var menu = document.getElementById("myUl");
                menu.style.visibility = "hidden";
            }
        }

    </script>
</head>
<body>
    <div id="myDiv"   style=" border:1px solid red ; width: 200px ;height : 200px">clickme</div>

    <ul id="myUl" style=" position:absolute ; visibility:hidden ; background-color: silver">
        <li>123</li>
        <li>456</li>
        <li>789</li>
    </ul>

</body>
</html>
